//
//  ExecuteAnalysisCell.swift
//  HuaYun
//
//  Created by enghou on 2018/12/18.
//  Copyright © 2018 xyxorigation. All rights reserved.
//

import UIKit

class ExecuteAnalysisCell: UITableViewCell {

    @IBOutlet weak var projectNameLabel: UILabel!
    @IBOutlet weak var contractNumLabel: UILabel!
    @IBOutlet weak var ticketNumLabel: UILabel!
    @IBOutlet weak var costNumLabel: UILabel!
    @IBOutlet weak var ratioNumLabel: UILabel!
    
    var _model: JSON?
    var model: JSON?{
        get{
            return _model
        }
        set{
            _model = newValue
            self.projectNameLabel.text = _model?.contents?["gsProjName"]?.rawString()
            let contract = _model?.contents?["signmoneyCount"]?.int ?? 0
            self.contractNumLabel.text = String(contract / 1000000).rmbformat
            let ticket = _model?.contents?["invoiceMoneyCount"]?.int ?? 0
            self.ticketNumLabel.text = String(ticket / 1000000).rmbformat
            let cost = _model?.contents?["executeCost"]?.int ?? 0
            self.costNumLabel.text = String(cost / 1000000).rmbformat
            let ratio = _model?.contents?["estimatedGrossprofit"]?.rawString()
            self.ratioNumLabel.text = ratio
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.contentView.backgroundColor = UIColor.tableSeparator
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
